<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function foo(a, b, c) {

    }
    var bar = function (m, n) {

    }
    foo.message = "Hello Foo"
    console.log(foo.message)
    // 默认函数对象中已经有自己的属性
    // 1.name属性
    console.log(foo.name)// foo
    console.log(bar.name)// bar

    var fns = [foo, bar]
    for (var fn of fns) {
      console.log(fn.name)
    }

    // 2.length属性:参数的个数
    function test() { }
    test(111, 222, 333)
    console.log(foo.length) // 3
    console.log(bar.length) // 2
    console.log(test.length) // 0

    function demo(...args) { }
    demo("abc", "cba", "nba")
    console.log(demo.length) // 0
    

  </script>
</body>

</html>